package com.example.computer_exam_training_sys.service;

import com.example.computer_exam_training_sys.dto.AchievementDTO;
import com.example.computer_exam_training_sys.entity.UserAchievement;
import java.util.List;

public interface UserAchievementService {
    
    /**
     * 获取用户所有成就
     */
    List<AchievementDTO> getUserAchievements(Long userId);
    
    /**
     * 获取用户指定类型的成就
     */
    List<UserAchievement> getUserAchievementsByType(Long userId, String achievementType);
    
    /**
     * 检查并解锁成就
     */
    void checkAchievements(Long userId, String activityType, Integer value);
    
    /**
     * 获取用户成就统计
     */
    AchievementStatistics getAchievementStatistics(Long userId);
    
    /**
     * 获取用户最近解锁的成就
     */
    List<UserAchievement> getLatestAchievements(Long userId, Integer limit);
    
    /**
     * 获取用户成就建议
     */
    List<AchievementSuggestion> getAchievementSuggestions(Long userId);
    
    /**
     * 成就统计信息
     */
    class AchievementStatistics {
        private Integer totalAchievements;
        private Integer learningAchievements;
        private Integer practiceAchievements;
        private Integer examAchievements;
        private Integer courseAchievements;
        private List<UserAchievement> recentAchievements;
        
        // Getters and setters
        public Integer getTotalAchievements() { return totalAchievements; }
        public void setTotalAchievements(Integer totalAchievements) { this.totalAchievements = totalAchievements; }
        public Integer getLearningAchievements() { return learningAchievements; }
        public void setLearningAchievements(Integer learningAchievements) { this.learningAchievements = learningAchievements; }
        public Integer getPracticeAchievements() { return practiceAchievements; }
        public void setPracticeAchievements(Integer practiceAchievements) { this.practiceAchievements = practiceAchievements; }
        public Integer getExamAchievements() { return examAchievements; }
        public void setExamAchievements(Integer examAchievements) { this.examAchievements = examAchievements; }
        public Integer getCourseAchievements() { return courseAchievements; }
        public void setCourseAchievements(Integer courseAchievements) { this.courseAchievements = courseAchievements; }
        public List<UserAchievement> getRecentAchievements() { return recentAchievements; }
        public void setRecentAchievements(List<UserAchievement> recentAchievements) { this.recentAchievements = recentAchievements; }
    }
    
    /**
     * 成就建议
     */
    class AchievementSuggestion {
        private String achievementType;
        private String achievementName;
        private String description;
        private Integer progress;
        private Integer targetValue;
        
        // Getters and setters
        public String getAchievementType() { return achievementType; }
        public void setAchievementType(String achievementType) { this.achievementType = achievementType; }
        public String getAchievementName() { return achievementName; }
        public void setAchievementName(String achievementName) { this.achievementName = achievementName; }
        public String getDescription() { return description; }
        public void setDescription(String description) { this.description = description; }
        public Integer getProgress() { return progress; }
        public void setProgress(Integer progress) { this.progress = progress; }
        public Integer getTargetValue() { return targetValue; }
        public void setTargetValue(Integer targetValue) { this.targetValue = targetValue; }
    }
} 